Skip to content

Collapse whitespace #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ralph-schleicher
Copy link

I had a problem when parsing an UTF-8 encoded RDF/XML document.

 (wilbur:collapse-whitespace "Grüß Gott")

Signals an error:

 Cannot decode this: (#\LATIN_SMALL_LETTER_U_WITH_DIAERESIS
                      #\LATIN_SMALL_LETTER_SHARP_S #\  #\G #\o
                      #\t #\t)
    [Condition of type SIMPLE-ERROR]

Here is a fix.

@lisp
Copy link
Owner

lisp commented Sep 15, 2021 via email

@arademaker
Copy link

Long time ago I faced similar problem. Better solution would be to remove from Wilbur all xml functions and delegate it to an external lib such as https://common-lisp.net/project/cxml/

@lisp
Copy link
Owner

lisp commented Sep 15, 2021

as i noted earlier, my interest in wilbur is curatorial.
the current dependencies are minimal.
preferences are for corrections rather than introducing significant dependencies.

it would be a significant compromise of its artifactual status to introduce a large dependency to replace an aspect which, in its state of incompleteness, expresses a judgement about the role of rdf-xml.
especially when the rdf ecosystem has moved on to numerous encoding alternatives.
while open-source lisp rdf environments have not, it is not clear that replacing that component of wilbur would change that situation.

i am open to being convinced otherwise.

@ralph-schleicher
Copy link
Author

the principle issue is that wilbur - in its inherited form, predates any reasonable support for utf encoding. the whitespace predicate appears to reflect this.

The character encoding should be handled by the reader, e.g. the web client - I'm using Drakma, which works well for me. Wilbur only has to deal with Lisp characters.

i am not a user (see dydra.com) and set it up here so that it would not disappear. if you intend to use it, would you consider integrating the capabilities which are now present in lisp implementations?

How do you imagine that? Shall I take over maintenance?

also, your whitespace characterization seems suspect.

I don't think so. It's according to the ASCII definition.

@lisp
Copy link
Owner

lisp commented Sep 15, 2021

if the goal is to make this artefact behave better with unicode, then wrt whitespace the class of non-graphic characters does not coincide with that of whitespace characters. https://en.wikipedia.org/wiki/Whitespace_character

@lisp
Copy link
Owner

lisp commented Sep 15, 2021

The character encoding should be handled by the reader, e.g. the web client - I'm using Drakma, which works well for me. Wilbur only has to deal with Lisp characters.

in some sense that is true, but the change removes the primitive support which it had for utf decoding in that one function, which leaves one to wonder where else that situation applies.

@lisp
Copy link
Owner

lisp commented Sep 15, 2021

How do you imagine that? Shall I take over maintenance?

you are certainly free to fork it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants